<?php


class View_viewTemplate
{
	
	public  $overview;
	
	public function View_viewTemplate(Controller $overview)
	{
		$this->JS=array();
		
		$this->overview=$overview;	
	}
	public function reDraw($source)
	{
		$source=View_Vars::Substitute($source,$this->overview);
		return $source;	
	}
	public function draw()
	{
		//ob_start( array (&$this , 'reDraw' ));
		include_once(VIEW_PATH."Themes/".THEME."/header.inc.php");
		if(count($this->overview->getView()->getJS())>0)
			$this->JS=$this->overview->getView()->getJS();

		foreach($this->JS as $js)
			echo '<script src="View/JS/'.$js.'" type="text/javascript"></script>'."\n";
		$this->overview->getView()->draw();
		
		include_once(VIEW_PATH."Themes/".THEME."/footer.inc.php");
		//ob_end_flush();		
			
	}
    
}

?>
